how to automate rest api using java